<%@ page import="JurisPro.modelo.Agenda"%>
<%@ page import="JurisPro.modelo.FilaEventos"%>
<%@ page import="java.util.Date"%>

<%@page import="java.text.SimpleDateFormat"%>
<jsp:include page="static/cabecalhoAdv.jsp"/>
  <tr align="center" valign="top" bgcolor="#E5E5E5">
   <td height="32" colspan="7">
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td class="arvore"><a href="/JurisPro/go_to?pagina=inicio">In&iacute;cio</a> --&gt; Agenda</td>
     </tr>
   </table>
     <table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
     
     <tr>
       <td width="620" height="39" bgcolor="#7C7E79" class="topicos">Agenda Processual<br /></td>
     </tr>
   </table>
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
         <td>&nbsp;</td>
       </tr>
     </table>
  <jsp:useBean id="eventos" type="java.util.List<JurisPro.modelo.FilaEventos>" scope="request" />
     <%if (eventos.size()!=0){ %>
     <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="tabela">
       <tr class="sub">
         <td>Pasta</td>
         <td height="30">Autor</td>
         <td>Parte</td>
         <td height="30">Descri&ccedil;&atilde;o</td>
         <td height="30">Local</td>
         <td height="30" colspan="2">Data/Hora</td>
       </tr>
           <%for(FilaEventos evento : eventos){       		
				SimpleDateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
				   int h = evento.getData().getHours();
				   int m = evento.getData().getMinutes();
				   String hora = ""+h;		if (h < 10) hora = "0"+h;
				   String minuto = ""+m;	if (m < 10) minuto = "0"+m;	
		   %>     				
       <tr bordercolor="#666666" class="texto">
         <td><%= evento.getPasta() %></td>
         <td><%= evento.getAutor()%> </td>
         <td><%= evento.getParte()%></td>
         <td><%= evento.getDescricao() %></td>
         <td><%= evento.getLocal() %></td>
         <td width="54" height="26"><%= fmt.format(evento.getData()) %></td>
         <td width="52"><%= hora %>:<%= minuto %></td>
       </tr>
       <% } %>
     </table>
     
     <table width="99%" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td class="novo">Imprimir&nbsp;&nbsp;</td>
         <td width="32" height="32"><a href="/JurisPro/go_to?pagina=imprimir_agenda" target = "_blank"><img src="images/icon_imprimir.gif" width="32" height="32" border="0" /></a></td>
       </tr>
     </table>
     <%} %>
     <p>&nbsp;</p>
     <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#CDCDCD">
      <tr>
        <td height="39" bgcolor="#7C7E79" class="topicos">Agenda Pessoal<br /></td>
      </tr>
    </table>
    <table width="80%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
	<jsp:useBean id="agenda" type="java.util.List<JurisPro.modelo.Agenda>" scope="request" />
   	<% if(agenda.size()!=0){ %>
    <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="tabela">
      <tr class="sub">
        <td width="101" height="30">Data</td>
        <td width="60" height="30">Hora</td>
        <td>Descri&ccedil;&atilde;o</td>
        <td>Local</td>
        <td height="30" colspan="2">A&ccedil;&otilde;es</td>
      </tr>
      <% String c1 = "#E5E5E5"; String c2 = "#f3f3f3"; int c3 = 1; %>
      <%for(Agenda comp : agenda){       		
				SimpleDateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
				%>			     	
			<tr bgcolor="<% if(c3 == 1) { c3 = 2; out.print(c1); } else { c3 = 1; out.print(c2); } %>" class="texto">
		<td height="26"><%= fmt.format(comp.getData())  %> </td>
		<% int h = comp.getData().getHours();
		   int m = comp.getData().getMinutes();
		   String hora = ""+h;		if (h < 10) hora = "0"+h;
		   String minuto = ""+m;	if (m < 10) minuto = "0"+m;	%>     				
				<td><%= hora %>:<%= minuto %></td>
				<td><%= comp.getDescricao() %></td>
				<td><%= comp.getLocal() %></td>
				<td width="66"><a class="link iframe" href="/JurisPro/go_to?pagina=editar_agenda&id=<%=comp.getIdAtividade() %>">Editar</a></td>
        		<td width="66"><a href="/JurisPro/do_it?comando=excluir_agenda&id_usuario=<%=comp.getIdUsuario()%>&id_atividade=<%=comp.getIdAtividade() %>" class="link">Excluir</a></td>
				
			</tr>
		<% }%>	
		
    </table>
    <%} %>
    <table width="80%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="novo">Novo Compromisso&nbsp;&nbsp;</td>
        <td width="32" height="32"><a class='iframe' href="/JurisPro/go_to?pagina=cad_comp"><img src="images/add.gif" width="32" height="32" border="0" /></a></td>
      </tr>
    </table>
    <p>&nbsp;</p></td>
  </tr>
</table>

<jsp:include page="static/rodape.jsp"/>